using System;
using SF.Code.Extension.HttpHelper.Downloader;

namespace SG.Productivity.DesktopControlPanel.ParallelQuery
{
    public class ProviderQueryResult : Tuple<QueryIdentifier, QueryRecord>, IPersistableWebResult<QueryIdentifier, QueryRecord>
    {
        private ProviderQueryResult(ref QueryIdentifier key, ref QueryRecord persistentrecord)
            : base(key, persistentrecord)
        {
            
        }

        public static ProviderQueryResult Create(ref QueryIdentifier key, ref QueryRecord persistentrecord)
        {
            return new ProviderQueryResult(ref key, ref persistentrecord);
        }

        #region Implementation of IPersistableWebResult<out QueryIdentifier,out QueryRecord>

        public QueryIdentifier Key
        {
            get { return Item1; }
        }

        public QueryRecord Data
        {
            get { return Item2; }
        }

        #endregion
    }
}